#pragma once

#include <vector>
#include <map>
#include "User.h"

using namespace std;

class UserCollection
{
public:
	UserCollection(void);
	~UserCollection(void);
	bool hasUser(const string& name);
	bool isValid(const string& name, const string& password);
	void addUser(const string& name, const string& password);
	User& getUserByName(const string& name);
	int getIdByName(const string& name);
	const User& getUserById( int id ) const;
	const int getUserNum() const;
private:
	vector<User*> users;
	map<string,int> userDict;
	int userIdSeq;
};